import { vueTemplate } from '@/utils/generator/html';
<template>
  <div v-if="isDetail">
    <el-dialog title="详情" :visible.sync="isDetail" width="70%" append-to-body>
      <div class="detail_con">
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span>订单详情</span>
          </div>
          <div>
            <el-descriptions class="margin-top" :column="3" border>
              <el-descriptions-item>
                <template slot="label"> 订单号 </template>
                {{ dataRow.dataPoolOrder.orderNo }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 订单时间 </template>
                {{ dataRow.dataPoolOrder.orderTime }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 券码号 </template>
                {{ dataRow.dataPoolOrder.redeemCode }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 订单金额 </template>
                {{ dataRow.dataPoolOrder.orderAmount }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 订单状态 </template>
                <el-tag
                  type="warng"
                  v-if="dataRow.dataPoolOrder.orderStatus == 0"
                  >已取消</el-tag
                >
                <el-tag v-else-if="dataRow.dataPoolOrder.orderStatus == 1"
                  >待支付</el-tag
                >
                <el-tag
                  type="success"
                  v-else-if="dataRow.dataPoolOrder.orderStatus == 2"
                  >已支付</el-tag
                >
                <el-tag
                  type="success"
                  v-else-if="dataRow.dataPoolOrder.orderStatus == 3"
                  >已发货</el-tag
                >
                <el-tag
                  type="danger"
                  v-else-if="dataRow.dataPoolOrder.orderStatus == 4"
                  >确认收货</el-tag
                >
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 支付方式 </template>
                <el-tag
                  type="warng"
                  v-if="dataRow.dataPoolOrder.orderPayType == 0"
                  >不需要支付</el-tag
                >
                <el-tag
                  type="success"
                  v-else-if="dataRow.dataPoolOrder.orderPayType == 1"
                  >现金</el-tag
                >
                <el-tag v-else-if="dataRow.dataPoolOrder.orderPayType == 2"
                  >积分</el-tag
                >
                <el-tag
                  type="danger"
                  v-else-if="dataRow.dataPoolOrder.orderPayType == 3"
                  >优惠券</el-tag
                >
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 取消时间 </template>
                {{ dataRow.dataPoolOrder.cancelTime }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 支付时间 </template>
                {{ dataRow.dataPoolOrder.payTime }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 发货时间 </template>
                {{ dataRow.dataPoolOrder.deliverGoodsTime }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 确认收货时间 </template>
                {{ dataRow.dataPoolOrder.confirmReceiptTime }}
              </el-descriptions-item>
            </el-descriptions>
          </div>
        </el-card>
        <el-card class="box-card" style="margin: 12px 0">
          <div slot="header" class="clearfix">
            <span>用户详情</span>
          </div>
          <div>
            <el-descriptions class="margin-top" :column="3" border>
              <el-descriptions-item>
                <template slot="label"> 用户姓名 </template>
                {{ dataRow.dataPoolUser.userName }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 用户手机号 </template>
                {{ dataRow.dataPoolUser.userPhone }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 微信openId </template>
                {{ dataRow.dataPoolUser.userWxOpenId }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> nhOpenId </template>
                {{ dataRow.dataPoolUser.userNhOpenId }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 用户状态 </template>

                <el-tag
                  type="success"
                  v-if="dataRow.dataPoolUser.userStatus == 1"
                  >正常</el-tag
                >
                <el-tag
                  type="danger"
                  v-else-if="dataRow.dataPoolUser.userStatus == 0"
                  >不正常</el-tag
                >
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 是否白名单用户 </template>
                <el-tag type="warng" v-if="dataRow.dataPoolUser.isWrite == 1"
                  >是</el-tag
                >
                <el-tag
                  type="success"
                  v-else-if="dataRow.dataPoolUser.isWrite == 0"
                  >否</el-tag
                >
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label">用户标识类别</template>
                <el-tag v-if="dataRow.dataPoolUser.userUniqueType == 1"
                  >手机号</el-tag
                >
                <el-tag v-else-if="dataRow.dataPoolUser.userUniqueType == 2"
                  >微信openId</el-tag
                >
                <el-tag v-else-if="dataRow.dataPoolUser.userUniqueType == 3"
                  >掌银openId</el-tag
                >
                <el-tag v-else-if="dataRow.dataPoolUser.userUniqueType == 4"
                  >手机号+wxOpenId</el-tag
                >
                <el-tag v-else-if="dataRow.dataPoolUser.userUniqueType == 5"
                  >nh手机号+nhOpenId</el-tag
                >
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 加白时间 </template>
                {{ dataRow.dataPoolUser.addWriteTime }}
              </el-descriptions-item>
            </el-descriptions>
          </div>
        </el-card>

        <el-card>
          <div slot="header" class="clearfix">
            <span>权益详情</span>
          </div>
          <div>
            <el-descriptions class="margin-top" :column="3" border>
              <el-descriptions-item>
                <template slot="label"> 权益领取手机号 </template>
                {{ dataRow.dataPoolPrizeThird.rightsInterestsGetPhone }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 权益名称 </template>
                {{ dataRow.dataPoolPrizeThird.prizeName }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 权益面值 </template>
                {{ dataRow.dataPoolPrizeThird.prizeFace }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 权益批次号 </template>
                {{ dataRow.dataPoolPrizeThird.couponBatchNumber }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 卡券号 </template>
                {{ dataRow.dataPoolPrizeThird.couponCode }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 卡券类型 </template>
                <el-tag
                  type="success"
                  v-if="dataRow.dataPoolPrizeThird.couponType == 1"
                  >卡号卡密</el-tag
                >
                <el-tag
                  type="success"
                  v-else-if="dataRow.dataPoolPrizeThird.couponType == 2"
                  >三方接口</el-tag
                >
                <el-tag
                  type="success"
                  v-else-if="dataRow.dataPoolPrizeThird.couponType == 3"
                  >实物</el-tag
                >
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 三方卡号 </template>
                {{ dataRow.dataPoolPrizeThird.thirdCardNumber }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 三方卡密 </template>
                {{ dataRow.dataPoolPrizeThird.thirdCardPassword }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 收货人姓名 </template>
                {{ dataRow.dataPoolPrizeThird.consigneeName }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 收货人手机号 </template>
                {{ dataRow.dataPoolPrizeThird.consigneePhone }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 收货地址 </template>
                {{ dataRow.dataPoolPrizeThird.consigneeAddress }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 发货时间 </template>
                {{ dataRow.dataPoolPrizeThird.sendTime }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 物流公司 </template>
                {{ dataRow.dataPoolPrizeThird.logisticsCompany }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 物流单号 </template>
                {{ dataRow.dataPoolPrizeThird.logisticsNumber }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 权益唯一标识 </template>
                {{ dataRow.dataPoolPrizeThird.uniqueIdentify }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 核销时间 </template>
                {{ dataRow.dataPoolPrizeThird.cancelTime }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 过期时间 </template>
                {{ dataRow.dataPoolPrizeThird.expireTime }}
              </el-descriptions-item>
              <el-descriptions-item>
                <template slot="label"> 核销状态 </template>
                <el-tag v-if="dataRow.dataPoolPrizeThird.cancelStatus == 0"
                  >未核销</el-tag
                >
                <el-tag
                  type="success"
                  v-else-if="dataRow.dataPoolPrizeThird.cancelStatus == 1"
                  >已核销
                </el-tag>
                <el-tag
                  type="warning"
                  v-else-if="dataRow.dataPoolPrizeThird.cancelStatus == 2"
                  >已过期</el-tag
                >
              </el-descriptions-item>
            </el-descriptions>
          </div>
        </el-card>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="cancel">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
export default {
  name: "detail",
  props: {
    dataRow: {
      type: Object,
      default: () => {
        return {};
      },
    },
    isDetail: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {};
  },
  methods: {
    cancel() {
      this.$emit("update:isDetail", false);
    },
  },
};
</script>
<style lang="scss" scoped>
.detail_con {
  max-height: 650px;
  padding: 10px;
  overflow: auto;
}
</style>
